home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / text / edit / Textra16.lha / Textra116 / Scripts / Files.textra < prev    next >
Encoding:
Text File  |  1993-12-19  |  2.1 KB  |  74 lines

  1.     /******************************************************************
  2.      *   TEXTRA AREXX script -- Mike Haas, 1993, All Rights Reserved.  *
  3.      * Freely distributable ONLY as a component of the TEXTRA package. *
  4.      * This banner may not be removed or altered (improvements to the  *
  5.      *    actual program welcome).  Please document and send to me.    *
  6.      *        !!! PLACE THIS FILE IN YOUR REXX: DIRECTORY !!!          *
  7.      ******************************************************************/
  8.  
  9. /* Usage:  Files
  10.  *
  11.  * This script accepts no parameters.  It opens a window titled
  12.  * 'ram:Textra Files' and then queries Textra about each of it's
  13.  * open windows, using the (new in 1.15) "GET window info" and
  14.  * "GET file info" commands.  All queried information is displayed
  15.  * in the opened window.
  16.  *
  17.  * Mike Haas
  18.  *
  19.  */
  20.  
  21. OPTIONS results
  22. /* trace all */
  23.  
  24. rex = 0; result = "NOTSUPPORTED"
  25. textraversion
  26. parse var result maj min rex
  27. if (result == "NOTSUPPORTED") | (rex < 10) then do
  28.     notify "Textra V1.15 or later required for this script."
  29.     exit
  30. end
  31.  
  32. openfile '"ram:Textra Files"';parse var result tfp
  33. if tfp = 0 then
  34.     exit
  35. clear
  36.  
  37. ii = 1
  38. get window ii; wp = result
  39.  
  40. do while wp ~= 0
  41.  
  42.     if wp ~= tfp then do
  43.     
  44.         selectwindow wp
  45.  
  46.         get file info
  47.         parse var result mod' 'numLines' 'memsize' 'disksize
  48.     
  49.         get window info
  50.         parse var result left' 'top' 'width' 'height' 'numVisLines' 'numVisChars
  51.     
  52.         get file name; fname = result
  53.         get file path; fpath = result
  54.         
  55.         selectwindow tfp
  56.         
  57.         newline
  58.         textn '"****************************************************"'
  59.         text  '"File: 'fpath'"';textn fname
  60.         textn '"----------------------------------------------------"'
  61.         textn '"Size in mem: 'memsize'  Size on disk: 'disksize'"'
  62.         textn '"Modified? 'mod'   Number of lines: 'numLines'"'
  63.         textn '"Window position (l t w h): 'left' 'top' 'width' 'height'"'
  64.         textn '"Number of visible lines high: 'numVisLines'"'
  65.         textn '"Number of visible chars wide: 'numVisChars'"'
  66.         textn '"****************************************************"'    
  67.         
  68.     end
  69.     
  70.     ii = ii + 1
  71.     get window ii; wp = result
  72. end
  73.     
  74.